From: Georges Basile Stavracas Neto Date: Mon, 31 May 2021 13:12:05 +0000 (-0300) Subject: dnd: Immediately start drag done by pointer devices X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~574^2^2~269 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5339b1e6a29dff0e23911be2df2bcb028b696498;p=gnome-shell.git dnd: Immediately start drag done by pointer devices Unlike touch screens, pointer devices (e.g. cursor, touchpad) are basically never used to switch app grid pages, which is the main use case for the drag threshold. This point was recently raised as design feedback. Immediately start drags when using pointer devices. See https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3802#note_1124701 Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4287 Part-of: --- diff --git a/js/ui/dnd.js b/js/ui/dnd.js index 4fbe1acc7..cefde6f60 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -508,9 +508,14 @@ var _Draggable = class _Draggable { if (!currentDraggable && (Math.abs(stageX - this._dragStartX) > threshold || Math.abs(stageY - this._dragStartY) > threshold)) { + const deviceType = event.get_source_device().get_device_type(); + const isPointerOrTouchpad = + deviceType === Clutter.InputDeviceType.POINTER_DEVICE || + deviceType === Clutter.InputDeviceType.TOUCHPAD_DEVICE; const ellapsedTime = event.get_time() - this._dragStartTime; - if (ellapsedTime > this._dragTimeoutThreshold) { + // Pointer devices (e.g. mouse) start the drag immediately + if (isPointerOrTouchpad || ellapsedTime > this._dragTimeoutThreshold) { this.startDrag(stageX, stageY, event.get_time(), this._touchSequence, event.get_device()); this._updateDragPosition(event); } else {